import {createStore} from "vuex"
import che from './che.js'
import chen from './chen.js'
import Group from './store_li.js/GroupClass.js'

export default createStore({
	namespaced: true,
	state: {
		a:123,
		userdata: {},
		orderPayGoods: [],
		userOrderHarvest: [],
		nowUserOrderHarvest: {},
		cartORgoods: 0,
		HarvestAddress:[],
		DefaultAddress:[],
		cardNow:{},
		makeAppGroup:[],
		// 场馆数据
		// venuesArr:[]
	},
	mutations: {
		// 修改用户信息
		editUserData(state, payload) {
			state.userdata = payload;
		},
		editUserAvatar(state,payload) {
			console.log(state.userdata[0].vipavatar)
			state.userdata[0].vipavatar = payload
		},
		// 添加订单中的商品
		pushOrderPayGoods(state, data) {
			state.orderPayGoods.push(data);
		},
		// 清空订单中的商品
		emptyOrderPayGoods(state, data) {
			state.orderPayGoods = [];
		},
		// 修改用户所有收货地址
		editUserOrderHarvest(state, data) {
			state.userOrderHarvest = data;
		},
		// 修改用户当前选中地址
		editNowUserOrderHarvest(state, data) {
			state.nowUserOrderHarvest = data;
		},
		// 区别购物车或商品发起订单支付
		editCartORgoods(state, data) {
			state.cartORgoods = data;
		},
		getAddress(state,data){
			state.HarvestAddress=data;
		},
		getDefault(state,data){
			state.DefaultAddress=data;
		},
		//存储当前会员卡信息
		getCardNow(state,data){
			state.cardNow=data;
		},
		// 存储场馆数据
		// getVenuesArr(state,data){
		// 	state.venuesArr=data
		// }
		getmakeAppGroup(state,data){
			state.makeAppGroup=data
		}
	},
	actions: {},
	getters: {},
	modules: {
		che,
		chen,
		//团课模块
		Group,
		}
})
